<?php
/*
* Class teia\webdev\php\core\PurchaseProcess
* Core class for a purchase process
* Stages: authentication, shipping, billing, order review, payment execution, confirmation
* @author Bernardo Quibiana
* @date created: 20111203
*
* @date modified: 20111203
* @modified: Bernardo Quibiana
*/

// namespace declaration: Abstract Data Types
namespace teia\webdev\php\core;

require_once 'IProcessDataSource.inc';
require_once 'TypePool.inc';

class PurchaseProcess implements IProcessDataSource {
	private $stages = array('Authentication', 'Shipping', 'Billing', 'Review', 'Payment', 'Confirmation');
	
	public function __construct($stages = NULL) {
		if ($stages) {
			$this->stages = $stages;
		}
	}
	
	/*
	 * IProcessDataSource
	 */
	public function get_num_stages() {
		return count($this->stages);	
	}
	
	public function get_stages_name() {
		return $this->stages;
	}
	
	public function get_stage_size($stage) {
		return 0;	
	}
	
	public function get_item_content($it_num, $stage) {
		return '';
	}
	
	public function get_stage_content($stage) {
		$content = "<p>content for stage: <b>$stage</b></p>";
		
		return $content;
	}
	
	/*
	 * Internal
	 */
	/**
	 * Enter description here ...
	 * @param unknown_type $stage
	 */
	public function generate_content($stage, $stage_name) {
		switch ($stage) {
			case PurchaseStage::AUTHENTICATION:
			;
			break;
			case PurchaseStage::SHIPPING:
			;
			break;
			case PurchaseStage::BILLING:
			;
			break;
			case PurchaseStage::REVIEW:
			;
			break;
			case PurchaseStage::PAYMENT:
			;
			break;
			case PurchaseStage::CONFIRMATION:
				;
				break;
			default:
				;
			break;
		}
	}
}
?>